package com.iis.hrms.persistence;

import javax.persistence.*;
import java.io.Serializable;
import java.util.List;

/**
 * The persistent class for the group_login database table.
 */
@Entity
@Table(name = "group_login")
@NamedQueries({
        @NamedQuery(name = "GroupLogin.findAll", query = "SELECT g FROM GroupLogin g"),
        @NamedQuery(name = "GroupLogin.findById", query = "SELECT g FROM GroupLogin g WHERE g.id = :id"),
        @NamedQuery(name = "GroupLogin.findByName", query = "SELECT g FROM GroupLogin g WHERE g.name = :name")})
public class GroupLogin implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(unique = true, nullable = false)
    private String id;

    @Column(nullable = false, length = 255)
    private String name;

    // bi-directional many-to-one association to Menu
    @OneToMany(mappedBy = "groupLogin")
    private List<Menu> menus;

    // bi-directional many-to-one association to Permission
    @OneToMany(mappedBy = "groupLogin")
    private List<Permission> permissions;

    public GroupLogin() {
    }

    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<Menu> getMenus() {
        return this.menus;
    }

    public void setMenus(List<Menu> menus) {
        this.menus = menus;
    }

    public List<Permission> getPermissions() {
        return this.permissions;
    }

    public void setPermissions(List<Permission> permissions) {
        this.permissions = permissions;
    }

}